<?php
/**
 * The template for displaying Archive pages.
 *
 * Used to display archive-type pages if nothing more specific matches a query.
 * For example, puts together date-based pages if no date.php file exists.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage MIP
 * @since MIP 1
 */

get_header(); ?>
	<div id="header_inner">
		<div id="headertext">
		<?php if (have_posts()) : the_post(); ?>
			<?php if ( is_day() ) : ?>
			<h1 class="pagetitle"><?php printf( __( 'Daily Archives: <span>%s</span>' ), get_the_date() ); ?></h1>
			<?php elseif ( is_month() ) : ?>
			<h1 class="pagetitle"><?php printf( __( 'Monthly Archives: <span>%s</span>' ), get_the_date('F Y') ); ?></h1>
			<?php elseif ( is_year() ) : ?>
			<h1 class="pagetitle"><?php printf( __( 'Yearly Archives: <span>%s</span>' ), get_the_date('Y') ); ?></h1>
			<?php else : ?>
			<h1 class="pagetitle"><?php printf( __( '%s' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1>
			<?php endif; ?>
		<?php endif; ?>
		<?php wp_reset_query();?>
		</div>
	</div>
	
	<!-- BEGIN CONTENT -->
	<div id="container_content">
	<div id="padding_content">
		<div id="maincontent">
			<div id="main">
				<div id="content">
		
			<?php if ( function_exists('yoast_breadcrumb') ) {
				yoast_breadcrumb('<div id="breadcrumbs">','</div>');
			} ?>
	
		<?php
			/* Since we called the_post() above, we need to
			 * rewind the loop back to the beginning that way
			 * we can run the loop properly, in full.
			 */
			rewind_posts();
		
			/* Run the loop for the archives page to output the posts.
			 * If you want to overload this in a child theme then include a file
			 * called loop-archives.php and that will be used instead.
			 */
			get_template_part( 'loop', 'archive' );
		?>
		
				</div><!-- end of content -->
			</div><!-- end of main -->
			<div id="side">
				<?php echo $sideBefore;?>
				<?php get_sidebar(); ?>
				<?php echo $sideAfter;?>
			</div><!-- end of side -->
		</div><!-- end of maincontent -->
	</div>
	<div class="clr"></div>
	</div>
	<!-- END OF CONTENT -->
	
	</div><!-- end of centercolumn -->
</div><!-- end of main container -->
<?php get_footer(); ?>
